<!--
 * @Author: Bennty
 * @Date: 2024-10-30 09:29:26
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2024-10-31 15:15:43
 * @Description: 请填写简介
-->
<template>
    <div class="p-2">
        <el-tabs class="demo-tabs" v-model="activeName" type="card">
            <el-tab-pane label="成品BOM" :name="1">
                <BOM :nowDate="date" />
            </el-tab-pane>
            <el-tab-pane label="半成品" :name="2">
                <semiProduct :nowDate="date" />
            </el-tab-pane>
            <el-tab-pane label="辅材" :name="3">
                <auxiliaries :nowDate="date" />
            </el-tab-pane>
        </el-tabs>
    </div>
</template>

<script setup lang="ts">
import BOM from './components/BOM.vue';
import semiProduct from './components/semiProduct.vue';
import auxiliaries from './components/auxiliaries.vue';

const activeName = ref(1);

const getNowDate = () => {
    const nowTime = new Date();
    const year = String(nowTime.getFullYear());
    const month = String(nowTime.getMonth() + 1).padStart(2, '0');
    const day = String(nowTime.getDate()).padStart(2,'0');
    return `${year}-${month}-${day}`;
};

const date = ref(getNowDate());

onMounted(()=>{
    // const nowDate = getNowDate();
    // queryParams.value.date = nowDate;
});
</script>

<style lang="scss" scoped>
.demo-tabs > .el-tabs__content {
    padding: 32px;
    color: #6b778c;
    font-size: 32px;
    font-weight: 600;
}
</style>